<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    {:token()}

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('获取定位地址')}:</label>
        <div class="col-xs-12 col-sm-8">
            <button type="button" class="btn btn-primary" data-toggle='addresspicker' data-input-id="address" data-lng-id="lng" data-lat-id="lat">点击选择地址获取经纬度</button>

        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('地址')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[dizhi]" id="address" value="{$row.dizhi|htmlentities}" placeholder="地址">

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('经度')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input  class="form-control"  id="lng" name="row[lng]"  value="{$row.lng|htmlentities}" placeholder="经度">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('纬度')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input  class="form-control"  id="lat"  name="row[lat]"  value="{$row.lat|htmlentities}" placeholder="纬度">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商家名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-user_id" data-rule="required" data-source="jiameng/getindex" data-field="username" class="form-control selectpage" name="row[jiameng_id]" type="text" value="{$row.jiameng_id|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label for="c-type" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                <option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <input id="c-pid" data-rule="required" class="form-control" name="row[pid]" type="hidden" value="0">

    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('电话')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-phone" data-rule="required" class="form-control" name="row[phone]" type="text" value="{$row.phone|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('平均消费')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-phone" data-rule="required" class="form-control" name="row[price]" type="text" value="{$row.price|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('营业时间')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="col-xs-12 col-sm-3">
                <input id="c-a" data-rule="required"  class="form-control datetimepicker form-control" data-date-format="HH:mm"
                       data-use-current="true" name="row[business_stare_time]" type="text" value="{$row.business_stare_time|htmlentities}">
            </div>
            <div class="col-xs-12 col-sm-1">至</div>
            <div class="col-xs-12 col-sm-3">
                <input id="c-a" data-rule="required"  class="form-control datetimepicker form-control" data-date-format="HH:mm"
                       data-use-current="true" name="row[business_end_time]" type="text" value="{$row.business_end_time|htmlentities}">
            </div>

        </div>
    </div>
    <div class="form-group">
        <label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" class="form-control" size="35" name="row[image]" type="text" value="{$row.image}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商家环境')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-images" class="form-control" size="50" name="row[images]" type="text" value="{$row.images|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-images"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-images"></ul>
        </div>
    </div>
    <div class="form-group">
        <label for="c-description" class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-description" class="form-control" name="row[description]">{$row.description|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label for="c-weigh" class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')], $row['status'])}
        </div>
    </div>

	<div class="form-group">
        <label for="c-port" class="control-label col-xs-12 col-sm-2">{:__('电控端口')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-port" class="form-control" name="row[port]" type="text" value="{$row.port}">
        </div>
    </div>

    <!-- 大牙 -->
    <div class="form-group">
        <label for="c-hall_lock_id" class="control-label col-xs-12 col-sm-2">{:__('大厅锁ID')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-hall_lock_id" class="form-control" name="row[hall_lock_id]" type="text" value="{$row.hall_lock_id}">
        </div>
    </div>

<!--    <div class="form-group">-->
<!--        <label for="c-lock_client_id" class="control-label col-xs-12 col-sm-2">{:__('锁接口ClienId')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-lock_client_id" class="form-control" name="row[lock_client_id]" type="text" value="{$row.lock_client_id}">-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="form-group">-->
<!--        <label for="c-lock_client_secret" class="control-label col-xs-12 col-sm-2">{:__('锁接口ClienSecret')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-lock_client_secret" class="form-control" name="row[lock_client_secret]" type="text" value="{$row.lock_client_secret}">-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="form-group">-->
<!--        <label for="c-lock_username" class="control-label col-xs-12 col-sm-2">{:__('锁账号')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-lock_username" class="form-control" name="row[lock_username]" type="text" value="{$row.lock_username}">-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="form-group">-->
<!--        <label for="c-lock_password" class="control-label col-xs-12 col-sm-2">{:__('锁密码')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-lock_password" class="form-control" name="row[lock_password]" type="text" value="{$row.lock_password}">-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="form-group">-->
<!--        <label for="c-message_name" class="control-label col-xs-12 col-sm-2">{:__('喇叭账号')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-message_name" class="form-control" name="row[message_name]" type="text" value="{$row.message_name}">-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="form-group">-->
<!--        <label for="c-message_secret" class="control-label col-xs-12 col-sm-2">{:__('喇叭Secret')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-message_secret" class="form-control" name="row[message_secret]" type="text" value="{$row.message_secret}">-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="form-group">-->
<!--        <label for="c-end_time_min" class="control-label col-xs-12 col-sm-2">{:__('订单结束提示分钟')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-end_time_min" class="form-control" name="row[end_time_min]" type="number" value="{$row.end_time_min}">-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="form-group">-->
<!--        <label for="c-end_time_content" class="control-label col-xs-12 col-sm-2">{:__('订单结束提醒内容')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-end_time_content" class="form-control" name="row[end_time_content]" type="text" value="{$row.end_time_content}">-->
<!--        </div>-->
<!--    </div>-->


    <div class="form-group">
        <label for="c-wifi_ssid" class="control-label col-xs-12 col-sm-2">{:__('wifi_名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-wifi_ssid" class="form-control" name="row[wifi_ssid]" type="text" value="{$row.wifi_ssid}">
        </div>
    </div>

    <div class="form-group">
        <label for="c-wifi_password" class="control-label col-xs-12 col-sm-2">{:__('wifi_密码')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-wifi_password" class="form-control" name="row[wifi_password]" type="text" value="{$row.wifi_password}">
        </div>
    </div>


    <div class="form-group">
        <label for="c-cancel_order_min" class="control-label col-xs-12 col-sm-2">{:__('前多少分钟可取消')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-cancel_order_min" class="form-control" name="row[cancel_order_min]" type="number" value="{$row.cancel_order_min}">
        </div>
    </div>

    <div data-toggle="cxselect" data-url="./meituan_auth/get_all_meituan_shop_json" data-selects="meituan_auth,meituan_shop" data-json-space="" data-json-sub="meituan_shop">


        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('所属美团授权')}:</label>
            <div class="col-xs-12 col-sm-8">

                <select data-value="{$row.meituan_auth_id}"  data-json-name="name" data-json-value="id" class="meituan_auth form-control" name="row[meituan_auth_id]"></select>

            </div>
        </div>


        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('对应美团门店')}:</label>
            <div class="col-xs-12 col-sm-8">

                <select  data-value="{$row.meituan_open_id}" data-json-name="shop_name" data-json-value="open_shop_uuid" class="meituan_shop form-control" name="row[meituan_open_id]"></select>

            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('对应抖音门店')}:</label>
            <div class="col-xs-12 col-sm-8">
                <select class="form-control" name="row[douyin_shop_id]">
                    <option value="0">请选择</option>
                    {foreach name="douyinList" item="vo"}
                    <option value="{$vo.id}" {if $row['douyin_shop_id'] == $vo['id'] }selected{/if}>{$vo.shop_name}</option>
                    {/foreach}
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('绑定商家账号')}:</label>
            <div class="col-xs-12 col-sm-8">
                <select id="c-seller_id" data-rule="required" class="form-control selectpicker" name="row[seller_id]">
                    <option value="0">请选择</option>
                    {foreach name="sellerList" item="vo"}
                    <option value="{$vo.id}" {if $row['seller_id'] == $vo['id'] }selected{/if}>{$vo.nickname}</option>
                    {/foreach}
                </select>
            </div>
        </div>
    </div>

    <!-- 大牙 -->
    <div class="form-group">
        <label for="c-wifi_password" class="control-label col-xs-12 col-sm-2">{:__('分账比例')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-profit_share_rate" class="form-control" name="row[profit_share_rate]" type="text" value="{$row.profit_share_rate}">
                <span class="input-group-addon">%</span>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('分账类型')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[profit_share_type]', ['1'=>__('商户号'), '2'=>__('个人号')], $row['profit_share_type'])}
        </div>
    </div>

    <div class="form-group" {if $row['profit_share_type'] == 2} style="display: none" {/if}>
        <label for="c-wifi_password" class="control-label col-xs-12 col-sm-2">{:__('商户号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-profit_share_merchant_id" class="form-control" name="row[profit_share_merchant_id]" type="text" value="{$row.profit_share_merchant_id}">
        </div>
    </div>

    <div class="form-group" {if $row['profit_share_type'] == 1} style="display: none" {/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('个人号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-profit_share_user_id" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[profit_share_user_id]" type="text" value="{$row.profit_share_user_id}">
        </div>
    </div>


    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
